package site.brood.common.log.feign;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import site.brood.common.core.constant.Constants;
import site.brood.common.core.web.AjaxJson;
import site.brood.common.log.pojo.LogLoginDto;
import site.brood.common.log.pojo.LogOperationDto;

/**
 * 日志服务
 *
 * @author ruoyi
 */
@FeignClient(name=Constants.LOG_SERVICE, fallbackFactory = LogFallbackFactory.class)
public interface LogFeign {
    /**
     * 保存操作日志
     *
     * @param logOperationDto 日志实体
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/operlog/add")
    public AjaxJson<Boolean> operLogAdd(@RequestBody LogOperationDto logOperationDto, @RequestHeader(Constants.FROM_SOURCE) String source);

    /**
     * 保存登陆日志
     *
     * @param logLoginDto 日志实体
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/loginlog/add")
    public AjaxJson<Boolean> loginLogAdd(@RequestBody LogLoginDto logLoginDto, @RequestHeader(Constants.FROM_SOURCE) String source);

}
